import turtle

# 数据
def circle(x0,y0, r):
    # 坐标
    pts = []
    x1 = int(x0+r/2**0.5)+1
    xy= lambda x,y:[(      x,      y),(      x, 2*y0-y),
                    ( 2*x0-x,      y),( 2*x0-x, 2*y0-y),
                    (x0-y0+y,y0-x0+x),(x0-y0+y,y0+x0-x),
                    (x0+y0-y,y0-x0+x),(x0+y0-y,y0+x0-x)]
    for x in range(x0,x1):
        y = y0+int((r**2-(x-x0)**2)**0.5)
        pts += xy(x, y)
    return pts

pts = circle(90,110, 50)

# 创建画布
turtle.setup(600,600, 300,50)
turtle.pensize(2) # 画笔大小，为1时不成像，遂为2
turtle.speed(0)
turtle.pencolor("blue")

# 画图
turtle.up()
for pt in pts:
    turtle.goto(*pt)
    turtle.down()
    turtle.goto(*pt)
    turtle.up()

# 结束
turtle.hideturtle() # 隐藏画笔箭头
turtle.done()

